package com.minimalist.common.config.eDict;

import java.lang.reflect.Method;
import java.util.Objects;

/**
 * 存放class和method
 *
 * @param <T>
 */
public class BeanMethod<T>{

    /**
     * class
     */
    private T bean;

    /**
     * method
     */
    private Method method;

    public BeanMethod() {
    }

    public BeanMethod(T bean, Method method) {
        this.bean = bean;
        this.method = method;
    }

    public T getBean() {
        return bean;
    }

    public void setBean(T bean) {
        this.bean = bean;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BeanMethod<?> that = (BeanMethod<?>) o;
        return Objects.equals(bean, that.bean) &&
                Objects.equals(method, that.method);
    }

    @Override
    public int hashCode() {
        return Objects.hash(bean, method);
    }

    @Override
    public String toString() {
        return "BeanMethod{" +
                "bean=" + bean +
                ", method=" + method +
                '}';
    }
}
